# coding=utf-8
import os
from collections import deque #栈
# 相对路径
from comment.modules.user import User
from financial.resorces.transaction import Invest_Resource

relative_path = '1_abc.jpg'
start = 1
# 获取绝对路径
absolute_path = os.path.abspath(relative_path)

basedir = os.path.abspath(os.path.join(os.getcwd()))
print(f"相对路径: {relative_path}")
print(f"绝对路径: {absolute_path}")
print(basedir)
#loan_list = User.query.filter(User.role == start)
#print(loan_list)

print('---------------------------------------------------')

class Deque:
    #定义栈
    def __init__(self,data):
        self.items = deque(data)

    #从栈中取数据
    def get_items(self):
        return self.items.popleft() #从左边去数据

    #从左边存数据
    def push(self):
        return self.items.appendleft(self.items)

    #判断是否数据为空
    @property
    def len_data(self):
        return len(self.items)

class data_item(object):

    #定义两个栈
    def __init__(self):
        data1 = 10
        data2 = 100
        self.data1 = Deque(data1)
        self.data2 = Deque(data2)
        print(data1)
        print(data2)

    #开始撮合
    def start_matched(self):
        while (not self.data1.len_data) and (not self.data2.len_data):
            #取数据
            data1 = self.data1.get_items()
            data2 = self.data2.get_items()
            if data1 > data2:
                print(data1,data2)
            if data1 < data2:
                print(data1,data2)
            if data1 == data2:
                print(data1,data2)








